home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / overview / dtscpluslibrary / sources / environmenttest.cp < prev    next >
Encoding:
Text File  |  2000-06-23  |  2.5 KB  |  86 lines

  1. /*
  2.     File:        EnvironmentTest.cp
  3.  
  4.     Contains:    TEnvironment is a Gestalt wrapper class that finds out information about the environment.
  5.                   EnvironmentTest.h contains the test functions for the TEnvironment class.
  6.  
  7.     Written by: Kent Sandvik    
  8.  
  9.     Copyright:    Copyright © 1992-1999 by Apple Computer, Inc., All Rights Reserved.
  10.  
  11.                 You may incorporate this Apple sample source code into your program(s) without
  12.                 restriction. This Apple sample source code has been provided "AS IS" and the
  13.                 responsibility for its operation is yours. You are not permitted to redistribute
  14.                 this Apple sample source code as "Apple sample source code" after having made
  15.                 changes. If you're going to re-distribute the source, we require that you make
  16.                 it clear in the source that the code was descended from Apple sample source
  17.                 code, but that you've made changes.
  18.  
  19.     Change History (most recent first):
  20.                 8/18/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  21.                 
  22.  
  23. */
  24. // INCLUDES
  25. #ifndef _ENVIRONMENT_
  26. #include "Environment.h"
  27. #endif
  28.  
  29. //    This test will check out the functions of the TEnvironment class. We assume that
  30. //  we are running on a fairly typical System 7.0.1/7.1 system.
  31.  
  32. void main(void)
  33.  
  34. {
  35.     cout << "Start of TEnvironment test…\n";
  36.     TEnvironment myEnvironment;
  37.  
  38.     //    128k TEST    
  39.     if (myEnvironment.Check128k())
  40.         cout << "We have a 128 or better system.\n";
  41.     else
  42.         cout << "We have an ancient Mac…\n";
  43.  
  44.     //    APPLEEVENTS TEST
  45.     if (myEnvironment.HasAppleEvents())
  46.         cout << "We have Apple Events.\n";
  47.     else
  48.         cout << "We don't have Apple Events.\n";
  49.  
  50.  
  51.     //    COLOR QUICKDRAW TEST
  52.     if (myEnvironment.HasColorQD())
  53.         cout << "We have Color Quickdraw.\n";
  54.     else
  55.         cout << "We don't have Color Quickdraw.\n";
  56.  
  57.     //  IS SYSTEM 7?
  58.     if (myEnvironment.IsSystemSeven())
  59.         cout << "We are running under System 7.\n";
  60.     else
  61.         cout << "We are NOT running under System 7.\n";
  62.  
  63.     //     TEST GENERIC ATTRIBUTE
  64.     if (myEnvironment.HasAttribute(gestaltFontMgrAttr, gestaltOutlineFonts))
  65.         cout << "We have TrueType font support.\n";
  66.     else
  67.         cout << "We DON'T have TrueType font support.\n";
  68.  
  69.  
  70.     //    CHECK IF THE X TRAP IS AVAILABLE
  71.     if (myEnvironment.TrapAvailable(OSTrap, 0xA82A))// Component Manager
  72.         cout << "We have _ComponentDispatch.\n";
  73.     else
  74.         cout << "We don't have _ComponentDispatch.\n";
  75.  
  76.  
  77.     cout << "End of TEnvironment test!\n";
  78. }
  79.  
  80. // _________________________________________________________________________________________________________ //
  81.  
  82. /*    Change History (most recent last):
  83.   No        Init.    Date        Comment
  84.   1            khs        11/9/92        New file
  85. */
  86.